import Vheader from './components/header/header.vue';
import { urlParse } from './common/js/util';
import './app.stylus';

export default {
    data() {
        return {
            seller: {
                id: (() => {
                    let queryParam = urlParse();
                    return queryParam.id;
                })()
            }
        }
    },
    created() {
        this.$http.get('./static/seller.json' ).then((response) => {
            // response = response.body;
            this.seller = { ...response.body };
          }); 
    },
    render() {
        return (
            <div id="app">
                <Vheader seller={this.seller}></Vheader>
                <div class="tab border-1px">
                <div class="tab-item">
                    <router-link to="/goods">商品</router-link>
                </div>
                <div class="tab-item">
                    <router-link to="/ratings">评论</router-link>
                </div>
                <div class="tab-item">
                    <router-link to="/seller">商家</router-link>
                </div>
                </div>
                {/* <!--优化状态--> */}
                <keep-alive>
                    <router-view seller={this.seller}></router-view>
                </keep-alive>
          </div>
        )
    }
}